package com.base.app_core.util;

import android.Manifest;

import java.util.UUID;

import okhttp3.MediaType;

/**
 * Created by jiansheng.li on 2018/1/13.
 */

public class AppConstants {

    public static final long ANI_DIALOG_FLOATING_TOP = 10;
    public static final long WELCOME_DELAY = 5 * 1000;
    /**
     * 广告时间
     */
    public static final int DEFAULT_AD_TIME = 5;
    public final static int LINE_CURSOR_WIDTH = 150;
    public static final int STOCK_COUNT_DEFAULT_NUM = 2;
    public static final int ACOUNT_DEFAULT_NUM = 2;
    /**
     * 支付成功
     */
    public static final int PAY_SUCCESS = 0;
    /**
     * 支付方式-阿里
     */
    public static final int PAY_TYPE_ALI = 0;
    public static final int PAY_CANCEL = -2;
    public static final int PAY_ERROR = 1;
    public static final int DEFAULT_VIEW_TIME = 3;
    public static final long INVALID_SMS_TIME_OUT = 10 * 1000;
    public static final String IFLY_APP_NATIVE_UNIT_ID = "6AC994F4E5923C4ED959DDFB2D36B78C";
    public static String adview_sdk_key = "SDK20181409020843mydde2dssu2ngqs";
    public static final String APP_ID = "1104776289";
    public static final String AD_ID = "8080737222465890";
    public static String SERVER_URL = "http://192.168.1.104:8087";
    public static String APPNAME = "全城红包";
    public static String APPICON = "";
    public static final int STATE_UNKNOWN = 0;
    public static final int STATE_LOADING = 1;
    public static final int STATE_ERROR = 2;
    public static final int STATE_EMPTY = 3;
    public static final int STATE_SUCCESS = 4;
    public static int PACKAGE_IMAGE_LENGHT = 10;
    public static long PACKET_TIME_OUT = 5 * 60 * 1000;
    public static String[] appPermission = new String[]{
            Manifest.permission.INTERNET,
            Manifest.permission.READ_PHONE_STATE,
            Manifest.permission.ACCESS_COARSE_LOCATION,
            Manifest.permission.READ_EXTERNAL_STORAGE,
            Manifest.permission.WRITE_EXTERNAL_STORAGE};

    public static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");
    /**
     * RSA 公共钥匙
     */

    public static final String publicJavaKey =
            "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmp2Nonk1d3nwBPtMTKEeTvP/7ODBj0eApTCvTXGmdNJNn7BiDKboFCAO7EgI250tTNWRVuppVa4rYbHSQVx1g1vjyWAc4Pd+metY0ht2F+mSPbRzTkLR0fxrDK0MqcAZhoAm7yjV5eqbnd1PuXxCC3KibLDZLUNs32hY732E9xQIDAQAB";
    /**
     * RSA 密匙
     */
    public static final String privateJavaKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAM4XBtOIFef79FxqbiV9PlCMY7dXZTlME8i28S5yTgLIEwaxgPGkqDl3AP2E8noMyZyEKB7ydIHKDIPxXavxVAxubNx9eJKHkhJAgTOxqRVFqBEQgnSH3CTRASXeyZAwFUY1Wb1zkDQpKucBIgAKIlxiMOhHxp8iq8xmeFqGFU5tAgMBAAECgYBEL2QnymeNCFRR2zi0GJrsZXZ8a2LnMR9+keB8AH+E9hMtbL7/s/2gfZoLRtg+v0pZCXSIwKkBZAr+AHaAc+jdV/GuVOpALbxWn+hj86BpHBSvKy5yK7+0JbQdNTrsSaX/zLu0GUJMBtCxMmn8iK3fA29AFNwNfXupxFi6y2UNYQJBAO87ebIBgQ05b+4FK2TkKg+Xeu5EtF6PJQJoHeE9WwFzmsxxbA5lg772XhlRHVoWMzRzkMBX2yt314GJVBXOygUCQQDciOFpjAwbKwV4XAnbrrO9EARNOKtwS24iQWSJkjABESEZmO7h37z5w3nKvwjit1W7lGEOOckha89lkj+FfldJAkEA3oC4rSDNAJm9Sumv9IRpwlqnUVjBUXldeKGRuN4x+GWnQiLz12f/YusNlgplfFZNhak+pkaQaBtsauRpOmc8aQJBAJfJcnQF2zM7yhkMKBDWzoj7JCrOLVkt4ZCcN4lkX7vsQT7v/sLiDpxNiV8dWw1IKC7iMmbrKN7i6C09mpDT41kCQQDpAhKa9TTbv+SC9Nwe0anSrKEDKIIxWzfZS4MIY+oKpl/tspJUUlJhETY/gS3UYPTnI+gt9WAg0BHzu17R1/Yg";

    public static String getPushTag() {
        return MD5Util.encrypt(Preferences.getDefault().getString(SP.JPUSH_KEY, UUID.randomUUID().toString()));
    }

    public interface BusAction {
    }

    public static class Const {
        public static final String UNDISCLOSE = "undisclose";
//        public static final String CACHE_DIR = App.getContext().getExternalCacheDir().getAbsolutePath();
        public static final int PAGESIZE = 10;
        public static final long REFRESHTIME = 1500;
        public static final String ADDIMAGETAG = "ADDIMAGE_FIX";
        public static final int PAYTYPE_WEICHAT = 0;
        public static final int PAYTYPE_ALI = 1;
        public static final String DEFAULT_TABLE = "全国";
        public static final long REFRESH_TIME = 1000 * 10;
        public static final long REFRESH_TIME_INIT = 1000;
        public static final Integer MI_TYPE = 1;
        public static final Integer SPREASH_TYPE = 0;
        public static boolean NeedLogin = false;
        public static final String K = "jmld8888";
    }

    public static boolean NeedLogin = false;

    public static class Global {
        public static String http_iden = "http://";
    }

    public class URLCONST {
        public static final String FETCHREGIONBYPARENTID = "/region/{parentId}";
        public static final String WXLOGIN = "/xybuser/login";
        public static final String SEND_PACKET = "/red/pre_order.do";
        public static final String WXPAY = "/xybpay/wxpay";
        public static final String FETCH_USER_ACCOUNT = "/xybuser/user-account";
        public static final String POSTUSERLOC = "/xybuser/updateLocation";
        public static final String GET_POI_LIST = "/index/getPoiPlaceSearch";
        public static final String FETCHNEARREDPACKET = "/xybuser/canredpacket";
        public static final String GETSMSCODE = "/sms/send-sms-code-for-bind";
        public static final String BINDUSERMOBILE = "/xybuser/user-mobile-bind";
        public static final String FETCHREDPACKETDETAIL = "/red/detail.do";
        public static final String FETCHREDUSERLIST = "/packet/fetch-user-list";
        public static final String POSTCOMMENT = "/red/comment.do";
        public static final String FETCHCOMMENTLIST = "/red//usercomment-list.do";
        public static final String FETCHRECVHISTORYREDPACKETS = "/xybuser/getrecvred";
        public static final String FETCHSENDHISTORYREDPACKETS = "/xybuser/getsndred";
        public static final String OPENREDPACKET = "/xybuser/openred";
        public static final String FETCH_RECV_SND_REDPACKET_COUNT = "/xybuser/srredcount";
        public static final String SYSTEM_FETCH_HISTORY_STOCK = "/sys/historystock";
        public static final String FETCHSTOCKPRICELOG = "/sys/stock_log.do";
        public static final String FETCHSTOCKCOUNTLOG = "/xybuser/fetch-stock-log";
        public static final String POSTDEPOSIT = "/xybuser/draw-deposit";
        public static final String FETCHHISTORYDEPOSITLOG = "/xybuser/fetch-deposit-log";
        public static final String USER_SHARE_LIST = "/xybuser/share-list";
        public static final String INDEX_SYSTEM_NOTICE = "/sys/notice.do";
        public static final String ALIPAY = "/payment/alipay";
        public static final String ALIPOSTDEPOSIT = "/xybuser/ali-with-draw-deposit";
        public static final String TASK = "/task/task";
        public static final String SUBMIT_TASK = "/task/taskSubmit";
        public static final String CALL_BACK_TEST = "/payment/callback/test";
        public static final String BINDALIACCOUNT = "/user/bindAliAcount";
        public static final String INDEX_GET_COS_KEY = "/cos/Key.do";
        public static final String CHECKREDSNOPENSTATE = "/xybuser/getopenredstatus";
        public static final String SYSTEM_CONFIG = "/sys/config.do";
        public static final String CHECK_STATUS = "/packet/checkstatus";
        public static final String USER_HELPER = "/user/helper";
        public static final String DEFAULT_ALI_SNCODE = "/user/fetch-default-aliAcount";
        public static final String IDNEX_GET_ADVERTISE_INFO = "/sys/advertiseInfo.do";
    }

    public class FIELD {
        public static final String PARENTID = "parentId";
        public static final String PROVINCEID = "provinceId";
        public static final String CITYID = "cityId";
        public static final String DISTRICTID = "districtId";
        public static final String LOCATION = "location";
        public static final String TOKEN = "token";
        public static final String CREDENTIAL = "credential";
        public static final String CONTENT = "content";
        public static final String NUM = "num";
        public static final String ACCOUNT = "account";
        public static final String PASSWORD = "password";
        public static final String RANGE = "range";
        public static final String LNG = "lng";
        public static final String LAT = "lat";
        public static final String ORDERCODE = "orderCode";
        public static final String KEY_WORD = "keyword";
        public static final String BOUNDARY = "boundary";
        public static final String MOBILE = "mobile";
        public static final String SMSCODE = "smsCode";
        public static final String REDPACKETID = "redpacketId";
        public static final String PAGE = "page";
        public static final String PAGESIZE = "limit";
        public static final String COMMENTCONTENT = "comment";
        public static final String IMGS = "imgs";
        public static final String PASSWD = "passwd";
        public static final String STOCKCOUNT = "stockCount";
        public static final String PUSH_TAG = "pushTag";
        public static final String PHONE_TYPE = "phoneType";
        public static final String PROVINCE_CODE = "provinceCode";
        public static final String CITY_CODE = "cityCode";
        public static final String AREA_CODE = "areaCode";
        public static final String TYPE = "type";
        public static final String STATUS = "status";
        public static final String MEMO = "memo";
        public static final String ALIACCOUNT = "aliAccount";
        public static final String NAME = "name";
        public static final String URL = "url";
        public static final String TASKID = "taskId";
        public static final String SN = "sn";
        public static final String SMS_TYPE = "smsType";
        public static final String SNCODE = "snCode";
        public static final String USER_REALNAME = "userRealName";
        public static final String AD_TYPE = "adType";
    }

    public class SP {
        public static final String JWTOKEN = "jwtoken";
        public static final String IS_FIRST = "isFirst";
        public static final String LAT = "lat";
        public static final String LNG = "lng";
        public static final String RANGE = "range";
        public static final String PROVINCE_COODE = "procode";
        public static final String CITY_COODE = "citycode";
        public static final String AREA_COODE = "areacode";
        public static final String JPUSH_KEY = "jpush_key";
        public static final String E = "E";
        public static final String N = "N";
        public static final String IMEI = "imei";
        public static final String ALI_ACCOUNT = "ali_account";
        public static final String USER_REALNAME = "user_realname";
        public static final String SNCODE = "sncode";
        public static final String PAY_TYPE = "pay_type";
        public static final String WITH_DRAW_TYPE_LIMIT = "with_draw_type_limit";
        public static final String MOBILE = "mobile";
        public static final String ID = "id";
        public static final String PWD_ENABLE = "pwd_enable";
        public static final String ENTER_WRONG_TIME = "ENTER_WRONG_TIME";
        public static final String IS_DEBUG = "is_debug";
        public static final String ADVERTISE_URL = "advertise_url";
        public static final String ADVERTISE_IMG = "advertise_img";
        public static final String IS_NEED_SIM = "is_need_mobile_sim";
        public static final String SHARE_SCALE_PERCENT = "shareScalePercent";
    }

    public class EXTRA {
        public static final String LOCATION_INFO = "location_info";
        public static final String PASSWORD = "password";
        public static final String IS_FROM_LOGIN = "IS_FROM_LOGIN";
        public static final String WEB_URL = "WEB_URL";
        public static final String WEB_CONTENT = "WEB_CONTENT";
        public static final String TYPE_EXTRA = "TYPE_EXTRA";
        public static final String IS_SHARE = "IS_SHARE";
    }

    public class ERROR_CODE {
        public static final String NEED_LOGIN = "1000";
        public static final String SYSTEM_BUSY = "1036";
        public static final String NEED_MOBILE = "1044";
    }

    public class ROUTEURI {
        public static final String LOGIN = "/user/loginActivity";
        public static final String MOBILE = "/member/bindmobile";
        public static final String TASK = "/user/task";
        public static final String GIVE_REDPACKET = "/redpacket/give";
        public static final String SHARE = "/user/share";
        public static final String BINDALIACCOUNT = "/user/bind-ali-account";
        public static final String USERASSETS = "/user/assets";
        public static final String SELECT_PACKET_LOCATION = "/redpacket/select-location";
        public static final String RED_PACKET_HISTROY = "/user/history";
        public static final String USER_DETAIL = "/user/detail";
        public static final String BASE_WEB_VIEW = "/base/webview";
        public static final String BASE_AD_VIEW = "/redpacket/ad_detail";
        public static final String OPEN_PACKET = "/redpacket/open_packet";
        public static final String FETCH_MINE = "/fetch/mine";
    }
}
